#root {
    --overlay-color: rgba(255, 255, 255, 0.05);
}
@media (prefers-color-scheme: dark) {
    :root {
        --overlay-color: rgba(0, 0, 0, 0.1);
    }
}

body {
    background: var(--box-background) !important;
    color: var(--box-color) !important;
    font-size: 13px;
    overflow-y: hidden;
    padding: 20px 10px;
}

a {
    color: var(--blue-40);
}
a:hover {
    color: var(--blue-50);
}
a:hover:active {
    color: var(--blue-60);
}

input:placeholder-shown {
    text-overflow: ellipsis;
}

.form {
    display: flex;
    flex-direction: column;
}

.form__footer {
    align-items: center;
    display: flex;
    margin-top: 20px;
}

.form__buttons {
    align-items: center;
    display: flex;
    gap: 5px;
    margin-inline-start: auto;
}

.form__status-line {
    color: var(--secondary-color);
}

.bridge {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
    order: -1;
    padding-bottom: 20px;
}

.bridge,
.bridge__loading {
    display: flex;
    flex-direction: column;
}

.bridge__loading {
    align-items: center;
    align-self: center;
    font-size: 1.25em;
    font-weight: 300;
    width: 30%;
}

.bridge__loading progress {
    margin-top: 5px;
    width: 100%;
}

.bridge__info {
    display: flex;
    padding-inline-start: 25px;
    position: relative;
}

.bridge__info--error {
    padding-inline-end: 25px;
}
.bridge__info--found .bridge__status {
    border-inline-end: 1px solid var(--border-color);
    padding-inline-end: 25px;
}

.bridge__info--error .bridge__status {
    display: grid;
    grid-template-columns: min-content 1fr;
    grid-template-rows: min-content 1fr;
    grid-template-areas:
        "status-icon status-title"
        "status-icon status-text";
    gap: 5px 20px;
}
.bridge__info--found .bridge__status-icon {
    margin-block-end: 5px;
}
.bridge__info--error .bridge__status-icon {
    grid-area: status-icon;
}
.bridge__info--error .bridge__status-title {
    grid-area: status-title;
    white-space: normal;
}
.bridge__info--error .bridge__status-text {
    grid-area: status-text;
    margin-top: initial;
    align-self: start;
}

.bridge__status {
    align-items: center;
    display: flex;
    flex-direction: column;
    margin-inline-end: 25px;
}

.bridge__status-title {
    margin: initial;
    font-weight: 600;
    font-size: 1.5em;
    white-space: nowrap;
}

.bridge__status-text {
    margin: initial;
    margin-top: 5px;
    font-size: 1.15em;
    text-align: center;
}
.bridge__stats {
    border-collapse: collapse;
    border-spacing: 0;
}

.bridge__stats th {
    font-weight: 600;
    padding-inline-end: 10px;
    text-align: end;
    vertical-align: top;
    white-space: nowrap;
}

.bridge__refresh {
    background-image: url("../assets/photon_refresh.svg");
    position: absolute;
    right: 0;
    top: 0;
}

.bridge__options {
    margin-top: 30px;
}
.bridge__daemon-options {
    column-gap: 10px;
    border: initial;
    display: flex;
    flex-direction: column;
    row-gap: 5px;
    margin-left: 20px;
}
.bridge__daemon-options > .option:not(.option--inline) {
    display: flex;
    gap: inherit;
}

.bridge__update-info {
    align-items: center;
    display: flex;
    margin-top: 10px;
}

.bridge__update-label {
    display: inline-block;
    margin: initial;
}

.bridge__update-options {
    align-items: center;
    display: inline-flex;
    gap: 10px;
    margin-left: 10px;
}

.bridge__update-start {
    align-self: flex-end;
    margin-top: 5px;
}

.bridge--update-status {
    margin-left: 10px;
}

.bridge__backup-host,
.bridge__backup-port {
    margin-left: 2px;
    margin-right: 2px;
}

.bridge__backup-host {
    width: 125px;
}
.bridge__backup-port {
    width: 75px;
}
.bridge__backup-password {
    display: block;
    margin-left: 20px;
    margin-top: 5px;
}

.category {
    border: initial;
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    grid-column-gap: 10px;
    grid-row-gap: 5px;
    margin: initial;
    padding: 10px 0;
}

.form > .category {
    border-bottom: 1px solid var(--border-color);
}

.category > hr {
    border: initial;
    border-top: 1px solid var(--border-color);
    grid-column: span 2;
    width: 100%;
}
.category > details {
    display: contents;
}
.category > details > summary {
    grid-column: 2;
    margin-top: 5px;
}
.category > details:not([open]) > summary ~ * {
    display: none;
}
.category > details:not([open]) > summary,
.category > details[open] > :last-child {
    margin-bottom: 5px;
}

.category__name {
    float: left;
}

.category__name > h2 {
    font-size: 1.15em;
    font-weight: 600;
    margin: initial;
}

.category__description {
    color: var(--secondary-color);
    margin-top: initial;
    max-width: 60ch;
}

.category__name,
.category__description,
.category .category {
    grid-column: span 2;
}

.option {
    display: contents;
}

.option--inline {
    align-items: baseline;
    column-gap: 4px;
    display: grid;
    grid-column-start: 2;
    grid-template-columns: min-content 1fr;
    grid-template-rows: min-content min-content;
    grid-template-areas:
        "input label"
        ". description";
}

.option--inline > input {
    grid-area: input;
    width: 16px;
}
.option--inline > .option__label {
    grid-area: label;
    text-align: initial;
}
.option--inline > .option__description {
    grid-area: description;
}

.option__label {
    text-align: right;
    display: inline-block;
}

fieldset:disabled .option__label,
fieldset:disabled .option__description {
    opacity: 0.65;
}

.option__recommended {
    background-color: var(--blue-60);
    border-radius: 2px;
    color: white;
    font-size: smaller;
    margin-inline-start: 5px;
    padding: 0 5px;
}

.option__description {
    color: var(--secondary-color);
    font-size: smaller;
    grid-column: span 2;
    margin: 5px 0;
    max-width: 60ch;
}

.option > input,
.option > select {
    align-self: center;
    justify-self: flex-start;
    margin-inline-start: initial;
}

.mirroring-stream > summary {
    color: var(--secondary-color);
}
.mirroring-stream__options {
    background-color: var(--overlay-color);
    border-radius: 4px;
    column-gap: 10px;
    display: flex;
    flex-direction: column;
    grid-column: 2;
    padding: 10px 20px;
    row-gap: 5px;
}
.mirroring-stream__options > .option:not(.option--inline) {
    display: flex;
    gap: inherit;
}
.mirroring-stream__options .option__label {
    flex-shrink: 0;
}

.whitelist {
    background-color: var(--box-background);
    border: 1px solid var(--border-color);
    color: var(--box-color);
    justify-content: end;
    padding: 5px;
}

.whitelist__view-actions {
    align-items: center;
    display: flex;
    gap: 5px;
    justify-content: end;
}

.whitelist hr {
    border: initial;
    border-top: 1px solid var(--border-color);
    margin: 5px 0;
}

.whitelist__items {
    display: flex;
    flex-direction: column;
    margin: initial;
    margin-inline-start: -5px;
    padding: initial;
    width: calc(100% + 10px);
}

.whitelist__item {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    column-gap: 5px;
    padding: 0 10px;
}

.whitelist__item:nth-child(even) {
    background-color: var(--overlay-color);
}

.whitelist__item--selected {
    background-color: var(--blue-50-a30) !important;
}
.whitelist__item--disabled:not(.whitelist__item--editing) .whitelist__title {
    opacity: 0.65;
}

.whitelist__title {
    display: flex;
    align-items: center;
    flex: 1;
    min-height: 34px;
    min-width: 0;
    padding: 4px;
    white-space: nowrap;
}

.whitelist__known-app {
    opacity: 0.5;
}
.whitelist__pattern {
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
}

.whitelist__input-pattern {
    font: inherit;
    width: -moz-available;
}

.whitelist__edit-button {
    background-image: url("../assets/photon_edit.svg");
}
.whitelist__remove-button {
    background-image: url("../assets/photon_delete.svg");
}
.whitelist__expand-button {
    background-image: url("../../assets/photon_arrowhead_down.svg");
}
.whitelist__item--expanded .whitelist__expand-button {
    background-image: url("../../assets/photon_arrowhead_up.svg");
}
.whitelist__add-button {
    background-image: url("../assets/photon_new.svg");
    margin-inline-end: auto;
}

.whitelist__expanded {
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: max-content 1fr;
    grid-column-gap: 10px;
    grid-row-gap: 5px;
    padding: 10px;
    width: 100%;
}

.whitelist__expanded .option:not(.option--inline) .option__label {
    max-width: 80px;
}

.translator__tag {
    color: #0a84ff;
    display: inline-block;
    font-size: 80%;
    font-weight: bold;
    margin-inline-start: 2px;
    text-transform: uppercase;
    vertical-align: text-top;
}

/* Option specific styles */
#siteWhitelistCustomUserAgent,
input[id^="customUserAgentString-"] {
    width: -moz-available;
}

.scaling-resolution input[type="number"],
.scaling-downscale input[type="number"] {
    width: 75px;
}
